package at.fhooe.mc.master.clc.server.dataaccess.dao;

import java.util.List;
import java.util.Map;
import java.util.Date;

import at.fhooe.mc.master.clc.shared.domain.FrameworkID;
import at.fhooe.mc.master.clc.shared.domain.metrics.IMetric;
import at.fhooe.mc.master.clc.shared.domain.metrics.MetricKey;

public interface IMetricsDao
{
	/**
	 * Request metrics from the datastore for the given parameters. <br>
	 * Note: startDate and endDate have to be given (cannot be null); filterIds and 
	 * filterMetricKeys can be set null - if set null the data will not be filtered.
	 * 
	 * @param startDate the start date of the interval that we want to request metrics for
	 * @param endDate the end date of the interval that we want to request metrics for
	 * @param filterId the framework id for filtering (if set null all framework metrics will be loaded)
	 * @param filterMetricKey the metric key for filtering (if wet null all metric keys will be loaded)
	 * @return
	 */
	public List<? extends IMetric> getMetrics(
			Date startDate, Date endDate, FrameworkID filterId, 
			MetricKey filterMetricKey);

	/**
	 * Saves the given metric in the datastore.
	 * @param metric
	 * @return
	 */
	public int saveMetric(IMetric metric);
	
	/**
	 * Deletes a given metric
	 * @param metric
	 * @return
	 */
	public int deleteMetric(IMetric metric);
	
	/**
	 * Removes the oldest metric from the datastore (so we can cleanup)
	 * @return
	 */
	public int deleteOldestMetric();
	
}
